//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.isunf.common.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;

public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
    private static String[] a = new String[]{"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm"};

    public DateUtils() {
    }

    public static String getDate() {
        return getDate("yyyy-MM-dd");
    }

    public static String getDate(String var0) {
        return DateFormatUtils.format(new Date(), var0);
    }

    public static String formatDate(Date var0, Object... var1) {
        String var2 = null;
        if (var1 != null && var1.length > 0) {
            var2 = DateFormatUtils.format(var0, var1[0].toString());
        } else {
            var2 = DateFormatUtils.format(var0, "yyyy-MM-dd");
        }

        return var2;
    }

    public static String formatDateTime(Date var0) {
        return formatDate(var0, "yyyy-MM-dd HH:mm:ss");
    }

    public static String getTime() {
        return formatDate(new Date(), "HH:mm:ss");
    }

    public static String getDateTime() {
        return formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
    }

    public static String getYear() {
        return formatDate(new Date(), "yyyy");
    }

    public static String getMonth() {
        return formatDate(new Date(), "MM");
    }

    public static String getDay() {
        return formatDate(new Date(), "dd");
    }

    public static String getWeek() {
        return formatDate(new Date(), "E");
    }

    public static Date parseDate(Object var0) {
        if (var0 == null) {
            return null;
        } else {
            try {
                return parseDate(var0.toString(), a);
            } catch (ParseException var2) {
                return null;
            }
        }
    }

    public static long pastDays(Date var0) {
        long var1 = (new Date()).getTime() - var0.getTime();
        return var1 / 86400000L;
    }

    public static Date getDateStart(Date var0) {
        if (var0 == null) {
            return null;
        } else {
            SimpleDateFormat var1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

            try {
                var0 = var1.parse(formatDate(var0, "yyyy-MM-dd") + " 00:00:00");
            } catch (ParseException var3) {
                var3.printStackTrace();
            }

            return var0;
        }
    }

    public static Date getDateEnd(Date var0) {
        if (var0 == null) {
            return null;
        } else {
            SimpleDateFormat var1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

            try {
                var0 = var1.parse(formatDate(var0, "yyyy-MM-dd") + " 23:59:59");
            } catch (ParseException var3) {
                var3.printStackTrace();
            }

            return var0;
        }
    }

    public static void main(String[] var0) {
    }
}
